import os
import random

def create_filename():
    filename_lst=[]
    lst=['水果', '蔬菜', '粮油']
    code=['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F']

    for i in range(1, 100):
        filename='{0:0>3}'.format(str(i))
        filename+='_'+random.choice(lst)
        s=''
        for j in range(9):
            s+=random.choice(code)
        filename+='_'+s
        filename_lst.append(filename)

    return filename_lst

def create_file(filename):
    with open(filename, 'w', encoding='utf-8') as f:
        pass


if __name__ == '__main__':
    path = './data'
    if not os.path.exists(path):
        os.mkdir(path)

    lst = create_filename()

    for name in lst:
        create_file(os.path.join(path, name) + '.txt')
